﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <meta name="application-name" content="LCTMoodle" />
    <meta name="description" content="LCTMoodle - Diễn đàn học tập của mọi người" />
    <meta name="keywords" content="diễn đàn học tập, moodle, lctgroup, lctmoodle, lct, lct group, lct moodle, mạng xã hội học tập" />
    <meta name="robots" content="index, follow">
    <meta name="author" content="lctgroup">

    <title>LCTMoodle</title>
    <link href="~/Content/image/header/logo/title-logo.png" rel="icon" />

    <link href="@Url.Content("~/Content/image/icon/strokeicon/css/pe-icon-7-stroke.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/Shared/_Khung.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Content/script/Shared/jquery-1.11.1.js")"></script>
    <script src="@Url.Content("~/Content/script/Shared/lctmoodle-ajax.js")"></script>
    <script src="@Url.Content("~/Content/script/Shared/helper.js")"></script>
    <script src="@Url.Content("~/Content/script/Shared/_Khung.js")"></script>    
</head>
<body>
    <article id="container">
    <header>
        <section id="top-header">
            <article class="link">
                @if (Session["NguoiDung"] == null)
                {
                    <article class="chua-dang-nhap">
                        <div class="popup-button">
                            <span class="show-next">
                                Đăng nhập
                            </span>
                            <article data-focus="#ten-dang-nhap">
                                <article>
                                    <form method="post" action="/DangNhap/XuLyDangNhap" enctype="application/x-www-form-urlencoded">
                                        <section class="input">
                                            <label for="ten-dang-nhap">
                                                Tên đăng nhập
                                            </label>
                                            <input id="ten-dang-nhap" name="TenDangNhap" type="text" />
                                        </section>
                                        <section class="input">
                                            <label for="mat-khau">
                                                Mật khẩu
                                            </label>
                                            <input id="mat-khau" name="MatKhau" type="password" />                                
                                        </section>
                                        <section class="check">
                                            <input id="duy-tri-dang-nhap" name="DuyTri" type="checkbox" hidden="hidden"/>
                                            <label for="duy-tri-dang-nhap">
                                                Duy trì đăng nhập
                                                <i class="switch"></i>
                                            </label>                                    
                                        </section>
                                        <section class="submit">
                                            <button type="submit">
                                                Đăng nhập
                                            </button>
                                        </section>
                                    </form>
                                </article>
                            </article>
                        </div>
                        ||
                        <a class="normal-link" href="/DangKy">
                            Đăng ký
                        </a>
                    </article>
                }
                else
                {
                    <article class="da-dang-nhap">
                        <span>
                            @(((LCTMoodle.Models.ViewModels.NguoiDungViewModel)Session["NguoiDung"]).hoTen)
                        </span>
                        ||
                        <a href="/NguoiDung/DoiMatKhau" class="popup-link">Đổi mật khẩu</a>
                        ||
                        <a href="/DangNhap/DangXuat">Đăng xuất</a>
                    </article>
                }
            </article>
        </section>
        <section id="bottom-header">
            <h1 class="logo">
                <a href="/">
                    <img src="@Url.Content("~/Content/image/header/logo/logo.png")" />
                </a>
                <i>LCTMoodle</i>
            </h1>
            <nav class="menu">
                <ul>
                    <li>
                        <a href="/KhoaHoc">
                            <i class="pe-7s-study"></i>
                            Khóa học
                            <u></u>
                        </a>
                    </li>
                    <li>
                        <a href="/HoiDap">
                            <i class="pe-7s-help1"></i>
                            Hỏi đáp
                            <u></u>
                        </a>
                    </li>
                </ul>
            </nav>
        </section>
    </header>
    <nav id="nav-bar">
        <ul>
            @{
                string[] siteMap = (string[])ViewData["SiteMap"];

                for (int i = 0; i < siteMap.Length; i += 2)
                {
                    <text> 
                    <li>
                        <a href="@siteMap[i + 1]">
                            @siteMap[i]
                        </a>
                    </li>
                    </text>
                }
            }
        </ul>
    </nav>
    <main>
        <aside id="col-2">
            <article class="section">
                <section class="caption">
                    <i class="pe-7s-menu"></i>
                </section>
                <ul id="tool-menu" class="menu">   
                    @{
                        if (Session["NguoiDung"] != null) 
                        {
                            List<LCTMoodle.Models.ViewModels.KhoaHocViewModel> khoaHoc = LCTMoodle.Service.KhoaHocService.layKhoaHoc_CuaNguoiDung(((LCTMoodle.Models.ViewModels.NguoiDungViewModel)Session["NguoiDung"]).ma);
                            if (khoaHoc.Count != 0)
                            {
                                <li id="menu-khoahoc">
                                    <a>
                                        <i class="sign"></i>
                                        Khóa học
                                        <i class="pe-7s-angle-down-circle"></i>
                                    </a>
                                    <ul>
                                        @{                                    
                                            if (khoaHoc != null)
                                            {
                                                for (int i = 0; i < khoaHoc.Count; i++)
                                                {
                                                    <li id="menu-khoahoc-@khoaHoc[i].ma">
                                                        <a href="/Nhom/@khoaHoc[i].ma">
                                                            <i class="sign"></i>
                                                            @khoaHoc[i].tenKhoaHoc
                                                        </a>
                                                    </li>
                                                }
                                            }
                                        }
                                    </ul>
                                </li>
                            }
                        }
                    }
                    @{
                        System.Collections.ArrayList menuAside = (System.Collections.ArrayList)ViewData["MenuAside"];
                        if (menuAside != null)
                        {
                            @createMenuAside(menuAside);
                        }
                    }
                    @*
                        1: Hiển thị
                        2: Tên class
                        3: Đường dẫn hoặc menu con
                    *@                    
                    @helper createMenuAside(System.Collections.ArrayList menuList)
                    {
                        for (int i = 0; i < menuList.Count; i += 3)
                        {
                            <li id="@menuList[i + 1]">
                                @if (menuList[i + 2].GetType() == typeof(string))
                                {
                                    <a href="@menuList[i + 2]">
                                        <i class="sign"></i>
                                        @menuList[i]
                                    </a>
                                }
                                else
                                {
                                    <a>
                                        <i class="sign"></i>
                                        @menuList[i]
                                        <i class="pe-7s-angle-down-circle"></i>
                                    </a>
                                    <ul>
                                        @createMenuAside((System.Collections.ArrayList)menuList[i + 2])
                                    </ul>
                                }
                            </li>
                        }
                    }                 
                </ul>
            </article>
        </aside>
        <article id="col-1">
            @{                
                if (TempData["ThongBao"] != null)
                {
                    string[] thongBao = (string[])TempData["ThongBao"];                
                    <article id="thong-bao" class="thong-bao">
                        <p class="@((thongBao.Length == 1 || thongBao[1] == "Xau") ? "xau" : "tot")">
                            @thongBao[0]
                        </p>
                    </article>
                }   
                else if (Request.QueryString["loi"] != null)
                {            
                    <article id="thong-bao" class="thong-bao">
                        <p class="xau">
                            @Request.QueryString["loi"]
                        </p>
                    </article>                    
                }
            }         

            @RenderBody()
        </article>
        <aside id="col-3">
            @RenderSection("RightAside", false)
            <section class="section">
                <article class="title">
                    <i class="icon"></i>
                    <h2 class="text">Tìm kiếm</h2>
                </article>
                <form id="search-box" method="get" action="
                    @if(TempData["TimKiem"] != null)
                    {
                        switch(TempData["TimKiem"].ToString())
                        {
                            case "HoiDap":
                                @:/HoiDap/TimCauHoi
                                break;
                            default:
                                @:/KhoaHoc/TimKhoaHoc
                                break;
                        }
                    }
                    else 
                    {
                        @:/KhoaHoc/TimKhoaHoc
                    }" class="box search-box">
                    <input name="ThongTin" placeholder="Bạn cần tìm gì?" />
                    <button type="submit"></button>
                </form>
            </section>
            <section class="section">
                <article class="title">
                    <i class="icon"></i>
                    <h2 class="text">Lịch sự kiện</h2>
                </article>
                <article id="calendar-box" class="box calendar-box">
                    <article class="now">
                        <section class="now-button">
                            <section class="date">
                            </section>
                            <section class="full-date">
                            </section>
                        </section>
                        <section class="write">
                            <a href="#">
                            </a>
                        </section>
                        <section class="event">
                        </section>
                    </article>
                    <article class="control">
                        <i class="previous-button"></i>
                        <i class="next-button"></i>
                        <div>3 - 2014</div>
                    </article>
                    <article class="calendar">
                        <table>
                            <thead>
                                <tr>
                                    <td>
                                        thứ<br />hai
                                    </td>
                                    <td>
                                        thứ<br />ba
                                    </td>
                                    <td>
                                        thứ<br />tư
                                    </td>
                                    <td>
                                        thứ<br />năm
                                    </td>
                                    <td>
                                        thứ<br />sáu
                                    </td>
                                    <td>
                                        thứ<br />bảy
                                    </td>
                                    <td>
                                        chủ<br />nhật
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </article>
                </article>
            </section>
            <section class="section">
                <article class="title">
                    <i class="icon"></i>
                    <h2 class="text">Hiện trạng</h2>
                </article>
                <article id="hop-dem" class="box counter-box">
                    <section>
                        <label>
                            Số lượng khách trực tuyến
                        </label>
                        <span class="khach-truc-tuyen">
                            @(((int[])HttpContext.Current.Application["BoDem"])[0])
                        </span>
                    </section>
                    <section>
                        <label>
                            Số lượng thành viên trực tuyến
                        </label>
                        <span class="thanh-vien-truc-tuyen">
                            @(((int[])HttpContext.Current.Application["BoDem"])[1])
                        </span>
                    </section>
                    <section>
                        <label>
                            Số lượng lượt đã truy cập
                        </label>
                        <span class="luot-da-truy-cap">
                            @(((int[])HttpContext.Current.Application["BoDem"])[2])
                        </span>
                    </section>
                </article>
            </section>
            <!--
            <section class="section">
                <article class="title">
                    <i class="icon"></i>
                    <h2 class="text">Tin tức</h2>
                </article>
            </section>
            <section class="section">
                <article class="title">
                    <i class="icon"></i>
                    <h2 class="text">Giảng viên trực tuyến</h2>
                </article>
            </section>
            <section class="section">
                <article class="title">
                    <i class="icon"></i>
                    <h2 class="text">Liên hệ</h2>
                </article>
            </section>
            -->
        </aside>
    </main>
    <footer>
        Copyright &copy; 2014 - LCTMoodle - Diễn đàn học tập của mọi người
        <!--
        <br />
        SVTH: Lê Bình Chiêu, Nguyễn Minh Chiến
        <br />
        GVHD: Lữ Cao Tiến
        -->
    </footer>
</article>
</body>  
</html>
